# Makefile for libsndfile using gcc 2.95.2

CC = gcc
LINK = gcc
LIBS = -lUnix:o.UnixLib

# 10/99 added -D__NO_MATH_INLINES to fix a bug in *all* versions of
# gcc 2.8+ as of 10/99.  

CC_SWITCHES = -IUnix: -D__NO_MATH_INLINES -fno-strength-reduce \
 -mapcs-stack-check -fomit-frame-pointer -mno-poke-function-name \
 -fexpensive-optimizations -fno-inline-functions -fno-unroll-loops \
 -fno-keep-static-consts -ffast-math -mfp=3 -Os -mtune=strongarm \
 -mcpu=arm7m -mno-short-load-bytes -msoft-float

OBJ = \
	aiff.o \
	alaw.o \
	au.o \
	au_g72x.o \
	common.o \
	paf.o \
	pcm.o \
	raw.o \
	sndfile.o \
	svx.o \
	ulaw.o \
	wav.o \
	wav_float.o \
	wav_gsm610.o \
	wvimaadpcm.o \
	wvmsadpcm.o

OBJG72X = \
	G72x/g721.o \
	G72x/g723_16.o \
	G72x/g723_24.o \
	G72x/g723_40.o \
	G72x/g72x.o

OBJGSM = \
	GSM610/add.o \
	GSM610/code.o \
	GSM610/decode.o \
	GSM610/gsm_create.o \
	GSM610/gsm_decode.o \
	GSM610/gsm_destroy.o \
	GSM610/gsm_encode.o \
	GSM610/gsm_option.o \
	GSM610/long_term.o \
	GSM610/lpc.o \
	GSM610/preprocess.o \
	GSM610/rpe.o \
	GSM610/short_term.o \
	GSM610/table.o

.c.o:
	$(CC) $(CC_SWITCHES) -Os -c -o $@ $<

libsndfile: $(OBJ) G72x/libg72x GSM610/libgsm Makefile
	drlink -aof $(OBJ) G72x.libg72x GSM610.libgsm -o libsndfile

G72x/libg72x: $(OBJG72X)
	drlink -aof G72x.o.* -o G72x.libg72x

GSM610/libgsm: $(OBJGSM)
	drlink -aof GSM610.o.* -o GSM610.libgsm

GSM610/code.o:
	$(CC) $(CC_SWITCHES) -c -o GSM610/code.o GSM610/code.c

GSM610/long_term.o:
	$(CC) $(CC_SWITCHES) -O -c -o GSM610/long_term.o GSM610/long_term.c

GSM610/lpc.o:
	$(CC) $(CC_SWITCHES) -c -o GSM610/lpc.o GSM610/lpc.c

GSM610/short_term.o:
	$(CC) $(CC_SWITCHES) -O -c -o GSM610/lshort_term.o GSM610/short_term.c
